<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>练习1</title>
		<script type="text/javascript">
			//创建5个学生对象，每个学生对象有3个属性，姓名：stuname, 性别：sex,学号:stuId
			
			let stu1 = {stuname:"张三",sex:"男",stuId:202102};
			let stu2 = {stuname:"李四",sex:"女",stuId:209104};
			let stu3 = {stuname:"王五",sex:"男",stuId:202302};
			let stu4 = {stuname:"赵六",sex:"女",stuId:202116};
			let stu5 = {stuname:"林七",sex:"男",stuId:232102};
			
			let arr = [];
			arr.push(stu1);
			arr.push(stu2);
			arr.push(stu3);
			arr.push(stu4);
			arr.push(stu5);
			
			for(let i = 0;i < arr.length;i++){
				if(arr[i].stuId == 202102) {
					console.log(arr[i].stuname + " " + arr[i].sex);
				}
			}
			
			for(let i = 0;i < arr.length;i++){
				if(arr[i].sex == "男") {
					console.log(arr[i].stuname + " " + arr[i].sex + " " + arr[i].stuId);
				}
			}
			
		</script>
	</head>
	<body>
	</body>
</html>
